package clas.ac.cn.common.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class StringEncodUtils {
    public static  String encodingUTF8(String target) throws UnsupportedEncodingException {
            if (target==null||target.isEmpty()){
                return null;
            }
            return URLEncoder.encode(target, "UTF-8");
    }

    public static  String decodingUTF8(String target) throws UnsupportedEncodingException {
        if (target==null||target.isEmpty()){
            return null;
        }
        return URLDecoder.decode(target, "UTF-8");
    }
}
